/**
公共样式
 */

/** S 背景颜色 **/

.bg-primary {
    background-color: $color-primary;
}

.bg-success {
    background-color: $color-success;
}

.bg-warning {
    background-color: $color-warning;
}

.bg-danger {
    background-color: $color-danger;
}

.bg-white {
    background-color: $color-white;
}

.bg-info {
    background-color: $color-info;
}

/** E 背景颜色 **/

/** E 字体颜色 **/

.primary {
    color: $color-text-primary;
}

.white {
    color: $color-white;
}

.black {
    color: $color-black;
}

.normal {
    color: $color-text-primary;
}

.lighter {
    color: $color-text-regular;
}

.muted {
    color: $color-text-secondary;
}

.blue {
    color: $color-primary;
}

.green {
    color: $color-success;
}

/** E 字体颜色 **/

/** S Font **/

// XL
.xl {
    font-size: $font-size-xl;
}

// LG
.lg {
    font-size: $font-size-lg;
}

// MD
.md {
    font-size: $font-size-md;
}

// NR
.nr {
    font-size: $font-size-nr;
}

// SM
.sm {
    font-size: $font-size-sm;
}

// SM
.xs {
    font-size: $font-size-xs;
}

// 字体大小 Example: f-s-[19-40]
@for $i from 19 through 40 {
    .f-s-#{$i} {
        font-size: $i + px;
    }
}

// 字体字重 Example: f-w-[100-900]
@for $i from 100 through 900 {
    @if $i % 100==0 {
        .f-w-#{$i} {
            font-weight: $i;
        }
    }
}

/** S Font **/

// 内、外边距[1-60]
@for $i from 0 through 60 {

    // 只要偶数和能被5整除的数
    @if $i % 2==0 or $i % 5==0 {

        // 如：m-30
        .m-#{$i} {
            margin: $i + px;
        }

        // 如：p-30
        .p-#{$i} {
            padding: $i + px;
        }

        @each $short,
        $long in l left,
        t top,
        r right,
        b bottom {

            //如： m-l-6
            // 外边距
            .m-#{$short}-#{$i} {
                margin-#{$long}: $i + px;
            }

            //如： p-l-30
            // 内边距
            .p-#{$short}-#{$i} {
                padding-#{$long}: $i + px;
            }
        }
    }
}

/** S 文本行数限制 **/

.line-1 {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.line-2 {
    -webkit-line-clamp: 2;
}

.line-3 {
    -webkit-line-clamp: 3;
}

.line-4 {
    -webkit-line-clamp: 4;
}

.line-2,
.line-3,
.line-4 {
    overflow: hidden;
    word-break: break-all;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
}

/** E 文本行数限制 **/

/** S 内容排序方式 **/
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/** E 内容排序方式 **/

/** S Flex-弹性布局 **/

.flex {
    display: flex;
    flex-direction: row;
}

.flex-inline {
    display: inline-flex;
}

.flex-col {
    flex-direction: column;
}

.flex-center {
    align-items: center;
    justify-content: center;
}

.flex-none {
    flex: none;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

.col-baseline {
    align-items: baseline;
}

.col-center {
    align-items: center;
}

.col-top {
    align-items: flex-start;
}

.col-bottom {
    align-items: flex-end;
}

.col-stretch {
    align-items: stretch;
}

.row-center {
    justify-content: center;
}

.row-left {
    justify-content: flex-start;
}

.row-right {
    justify-content: flex-end;
}

.row-between {
    justify-content: space-between;
}

.row-around {
    justify-content: space-around;
}

// Example: flex-[0-24]
@for $i from 0 through 24 {
    .flex-#{$i} {
        flex: $i;
    }
}

/** E Flex-弹性布局 **/

// 行内块元素
.inline {
    display: inline-block;
}

// 块元素
.block {
    display: block;
}

// 触手
.pointer {
    cursor: pointer;
}

// 块卡片
.ls-card {
    border-radius: 8px;
    background-color: $color-white;
}

.clearfix:after {
    content: '';
    display: block;
    clear: both;
    visibility: hidden;
}


.form-tips {
    display: block;
    line-height: 1.4;
    padding-top: 5px;
    font-size: 12px;
    color: $color-text-secondary;
}